#define _CRT_SECURE_NO_WARNINGS 1


int* selfDividingNumbers(int left, int right, int* returnSize) {
    int* arr = (int*)malloc(sizeof(int) * (right - left + 1));
    int d = 0;
    for (int i = left; i <= right; ++i)
    {
        int n = i;
        while (n)
        {
            if (n % 10 == 0 || i % (n % 10) != 0)
            {
                break;
            }
            n /= 10;
        }
        if (n == 0)
            arr[d++] = i;
    }
    *returnSize = d;
    return arr;
}